#include "SignalDisplay.h"
#include "SleepTimer.h"

SignalDisplay::SignalDisplay(History* pHistory)
	: _pHistory(pHistory)
{

}

void SignalDisplay::run()
{
	printf("SignalDisplay\n");

	SleepTimer t;
	while(1)
	{
		vector<Reading>	v = _pHistory->tail(10);
		printf("\nUpdating display\n---------------\n");
		fflush(stdout);
		for(int i = 0; i<v.size(); i++)
		{
			printf("(%i,%i)\n", v[i].timestamp, v[i].value);
		}
		t.sleep(250);
	}
}


